package pers.xds.wtuapp.web.es.bean;

import com.fasterxml.jackson.annotation.JsonInclude;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * 收购实体类
 * @author DeSen Xu
 * @date 2023-02-16 16:28
 */
@Document(indexName = "acquisition")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class EsAcquisition {

    @Id
    private int id;

    /**
     * 发布者uid
     */
    @Field(type = FieldType.Integer, index = false)
    private Integer ownerId;

    /**
     * 标题
     */
    @Field(type = FieldType.Text, analyzer = "ik_smart")
    private String title;

    /**
     * 创建时间
     */
    @Field(type = FieldType.Long, index = false)
    private Long createTime;

    /**
     * 预期价格
     */
    @Field(type = FieldType.Text, index = false)
    private String expectPrice;

    /**
     * 发布者昵称
     */
    @Field(type = FieldType.Text, index = false)
    private String nickname;

    public int getId() {
        return id;
    }

    public EsAcquisition setId(int id) {
        this.id = id;
        return this;
    }

    public Integer getOwnerId() {
        return ownerId;
    }

    public EsAcquisition setOwnerId(Integer ownerId) {
        this.ownerId = ownerId;
        return this;
    }

    public String getTitle() {
        return title;
    }

    public EsAcquisition setTitle(String title) {
        this.title = title;
        return this;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public EsAcquisition setCreateTime(Long createTime) {
        this.createTime = createTime;
        return this;
    }

    public String getExpectPrice() {
        return expectPrice;
    }

    public EsAcquisition setExpectPrice(String expectPrice) {
        this.expectPrice = expectPrice;
        return this;
    }

    public String getNickname() {
        return nickname;
    }

    public EsAcquisition setNickname(String nickname) {
        this.nickname = nickname;
        return this;
    }
}
